package com.example.my_music_palyer.mapper;

import com.example.my_music_palyer.model.Music;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface MusicMapper {
    int insert(@Param("title") String title, @Param("singer") String singer
            , @Param("time") String time,@Param("url")  String url,@Param("userid")  int userid, @Param("status") int status);

    Music isSymple(@Param("title")String title, @Param("singer")String singer);

    Music findMusicById(@Param("id") int id);

    int deleteMusicById(@Param("id") int id);

    List<Music> findMusicByMusicName(@Param("musicName") String musicName);

    List<Music> findMusic();

    List<Music> findMusicForUser(@Param("userId") int userId);

    List<Music> findAllMusic();

    List<Music> findAllMusicByMusicName(@Param("musicName") String musicName);

    List<Music> findMusicByMusicNameForUser(@Param("userId") int userId, @Param("musicName") String musicName);

    int updateMusicStatus(@Param("id") int id, @Param("status") int status);

    Music findByUrl(@Param("url") String url);

}
